package 剑指offer.demo7;
//https://www.nowcoder.com/practice/3194a4f4cf814f63919d0790578d51f3?
public class 翻转单词序列 {
    public String ReverseSentence(String str) {
        String[] s = str.split(" ");
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = s.length - 1; i >= 0 ; i--) {
            stringBuffer.append(s[i]);
            if (i != 0)
                stringBuffer.append(" ");
        }
        return stringBuffer.toString();
    }
}
